#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef double db;
typedef unsigned long long ull;
typedef long double ldb;

#define in read()
#define pii pair<int,int>
#define fi first
#define se second
#define FILE(x) freopen(x".in","r",stdin);\
	freopen(x".out","w",stdout);
#define pb push_back
#define vec vector<int>

int read(){int x = 0,sgn = 1;char ch = getchar();for(;!isdigit(ch);ch = getchar()) if(ch == '-') sgn = -1;for(;isdigit(ch);ch = getchar()) x = (x<<1)+(x<<3)+(ch^48);return x*sgn;}

const int N = 255;
const int W = 1010;

db f[W],mid;
int w[N],t[N],n,wl;

bool check(){
	for(int i = 1;i <= wl;i++) f[i] = -1e18;
	for(int i = 1;i <= n;i++)
		for(int j = wl;j >= 0;j--){
			int nw = j + w[i]; nw = min(nw,wl);
			f[nw] = max(f[nw],f[j] + t[i] - w[i] * mid);
		}
	return f[wl] >= 0;
}

int main (){
#ifndef ONLINE_JUDGE
	freopen("1.in","r",stdin);
#endif
	n = in;wl = in;
	for(int i = 1;i <= n;i++) w[i] = in,t[i] = in;
	db l = 0,r = 1e6;
	for(int i = 1;i <= 55;i++){
		mid = (l + r) / 2;
		if(check()) l = mid;else r = mid;
	}printf("%d\n",(int)(mid * 1000));
	return 0;
}
